/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package simulator.data;

import simulator.services.Clock;
import simulator.statistics.Utility;

/**
 *
 * @author Eran
 */
public class HumanData extends Data{
    
    private final String homeAddr;
    private final Clock sleepHour;
    private int funTravels_remained;
    public Clock totalSpendTime;
    public Clock timeSpent;
    private int funTravels_max;
    public boolean sick;
    
    
    public HumanData(String home, Clock leavingHour, int funTravels) {
        this.funTravels_max = funTravels;
        this.funTravels_remained = funTravels;
        
        this.homeAddr = home;
        this.sleepHour = Utility.generateStartSleepingHour(leavingHour);
        this.sick = false;
        
        this.timeSpent = new Clock();
        this.totalSpendTime = new Clock();
        Utility.generateSpendingTime(this.totalSpendTime);
    }

    public int getRemainingFunTravels() {
        return funTravels_remained;
    }

    public void resetRemainingFunTravels() {
        this.funTravels_remained = funTravels_max;
    }
    
    public void decrRemainingFunTravels() {
        this.funTravels_remained--;
    }

    public Clock getSleepHour() {
        return sleepHour;
    }
    
    public String getHomeAddr(){
        return homeAddr;
    }

    public void refreshSpendTime() {
        Utility.generateSpendingTime(this.totalSpendTime);
    }
}
